<?php

namespace App\Http\Middleware\Auth;

use Closure;

/**
 * 重置密码
 */
class ResetPwd
{

    /**
     * 前置 | 后置
     *
     * @param \Illuminate\Http\Request $request
     * @param \Closure $next
     * @return mixed
     */
    public function handle($request, Closure $next)
    {
        if (!$request->user()->pwd_reset) {
           return redirect()->route('pwd.request');
        }

        return $next($request);
    }
}
